#ifndef CONTACTDATA_H_
#define CONTACTDATA_H_

#include <QtCore>
#include <QtXml>
#include <iostream>
using namespace std;

class contact{
	public:
		QString name;
		QString phoneNum;
		bool isBlack;
		bool isAvailable(){
			if(name.length()!=0 &&
					phoneNum.length()!=0)
				return true;
			else
				return false;
		}
};

typedef QList<contact> contactList;

class contactData
{
	public:
		contactData();
		~contactData();
		contactList myList;
		contactList myListBlack;
		void moveToBlack(int row);
		void moveFromBlack(int row);
		//void addContact();//增加一个联系人
		void saveContactXml();
		void loadContactXml();
		QString getNameForNum(QString phoneNum);
};

#endif /* CONTACTDATA_H_ */

